home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 2008-12-10 | 558 b | 33 lines |
- Screen Open 0,640,256,4,Hires
- Dim K(3,1)
- Global K()
- Data 100,50,250,250,100,250,250,50
- Ink 4
- For I=0 To 3
- Read K(I,0),K(I,1)
- Plot K(I,0),K(I,1)
- Next
- Ink 2
- BEZIER[20]
- Wait Key
- End
- Procedure BEZIER[S]
- S#=S
- Dim P(3,3,1)
- For I=0 To 3
- P(I,0,0)=K(I,0)
- P(I,0,1)=K(I,1)
- Next
- M#=0.0
- Plot K(0,0),K(0,1)
- While M#<=1
- M#=M#+1.0/S#
- For J=1 To 3
- For I=0 To 3-J
- P(I,J,0)=P(I,J-1,0)+M#*(P(I+1,J-1,0)-P(I,J-1,0))
- P(I,J,1)=P(I,J-1,1)+M#*(P(I+1,J-1,1)-P(I,J-1,1))
- Next
- Next
- Polyline To P(0,3,0),P(0,3,1)
- Wend
- End Proc